From df2f5c9a30f8faadf8dee962cc17d315e967d70a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Mon, 20 Oct 2025 19:43:14 +0200 Subject: [PATCH] veth: delete device before creation to handle stale state When a veth device already exists in the kernel (from a previous failed cleanup or external creation), attempting to create it again with NLM_F_EXCL fails with -EEXIST. This leaves the device in a broken state where netifd marks it as present but cannot bring it up. Signed-off-by: Felix Fietkau --- veth.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/veth.c b/veth.c index 46b6eff..2f03456 100644 --- a/veth.c +++ b/veth.c @@ -68,6 +68,8 @@ veth_set_up(struct veth *veth) { int ret; + system_veth_del(&veth->dev); + ret = system_veth_add(&veth->dev, &veth->config); if (ret < 0) return ret; -- 2.30.2